package com.sdppf.service.impl;

import com.sdppf.dao.RecordCountHqlDao;
import com.sdppf.service.APageIndexService;

/**
 * AJax分页 页码 实现
 * @author ZXJ jimantou@gmail.com
 *
 */
public class APageIndexServiceImpl  implements APageIndexService{

	@Override
	public int GetIndex(String type,int pageContainNum) {
		String hql = "select count (*) from "+type;
		int result = (this.recordcountHqlDao.GetCount(hql)+pageContainNum-1)/pageContainNum;
		return result;
	}
	
	
	private RecordCountHqlDao recordcountHqlDao;
	public RecordCountHqlDao getRecordcountHqlDao() {
		return recordcountHqlDao;
	}
	public void setRecordcountHqlDao(RecordCountHqlDao recordcountHqlDao) {
		this.recordcountHqlDao = recordcountHqlDao;
	}
}
